package com.opencv.controller;

import com.opencv.service.ImportDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author qz.wu
 * @date 2021/8/26 14:40
 * @descriptions TODO
 */
@RestController("/import")
@Api(tags = "导入数据测试")
public class ImportDataController {


    @Autowired
    private ImportDataService importDataService;

    @ApiOperation("import query Api")
    @GetMapping("/query")
    public String query() {
        return importDataService.query();
    }

    @GetMapping("/excel/data")
    @ApiOperation("import excel data Api")
    public String importExcelData(@RequestParam(value = "path", required = false) String path) throws IOException {
        importDataService.importExcelData(path);
        return "success";
    }


}
